﻿package frEngine.shader.filters.vertexFilters
{
    import __AS3__.vec.*;
    import frEngine.shader.*;
    import frEngine.shader.filters.*;
    import frEngine.shader.filters.vertexFilters.def.*;

    public class CylinderAnimaterVertexFilter extends VertexFilter
    {
        public var params:Vector.<Number>;

        public function CylinderAnimaterVertexFilter(param1:Number, param2:Number, param3:Number)
        {
            this.params = this.Vector.<Number>([param1, param3, param2, 0]);
            super(FilterType.CylinderVertexFilter);
            return;
        }// end function

        override public function setRegisterParams(param1:Program3dRegisterInstance) : void
        {
            param1.getParamByName("{params}", true).value = this.params;
            return;
        }// end function

        override public function get programeId() : String
        {
            return "cylinderAnim0";
        }// end function

        override public function createVertexCode(param1:Program3dRegisterInstance, param2:int) : String
        {
            var _loc_3:Array = [];
            _loc_3.push(new ToBuilderInfo("vc0", "{params}", false, 1, this.params));
            _loc_3.push(new ToBuilderInfo("va0", FilterName.POSITION, false, 4));
            var _loc_4:String = "";
            _loc_4 = _loc_4 + "mul         \t vt0     \t\t \t vc0\t\t\t\t\tva0\t\t\t\t\t\t\t\n";
            _loc_4 = _loc_4 + "add           vt1.w      \t \t vt0.x\t\t\t\t\tvt0.z           \t\t\t\n";
            _loc_4 = _loc_4 + "cos           vt0.x     \t\t va0.w\t\t\t    \t       \t\t\t\t\t\t\n";
            _loc_4 = _loc_4 + "sin           vt0.z      \t \t va0.w\t\t\t\t\t           \t\t\t\t\n";
            _loc_4 = _loc_4 + "mul           vt0.xz     \t\t vt0.xz\t\t\t    \tvt1.ww       \t\t\t\t\n";
            _loc_4 = _loc_4 + "mov           vt0.w      \t \t {vcConst1}.z\t\t\t\t           \t\t\t\n";
            _loc_4 = _loc_4 + "mov           {output}      \t vt0\t\t\t\t           \t\t\t\t\t\n";
            _loc_4 = param1.toBuild(_loc_4, _loc_3);
            param1.OpType = ECalculateOpType.World_And_ViewProj;
            return _loc_4;
        }// end function

    }
}
